<template>
	<view class="fs-0" @click="updateDesensitize">
		<block v-if="color == 'brown'">
			<image v-if="!commonStore.desensitize" :src="imgBaseUrl + 'icon-eye-open-brown.png'" class="icon-32 ml-8" />
			<image v-else :src="imgBaseUrl + 'icon-eye-close-brown.png'" class="icon-32 ml-8" />
		</block>
		<block v-else>
			<image v-if="!commonStore.desensitize" :src="imgBaseUrl + 'icon-eye-open.png'" class="icon-32 ml-8" />
			<image v-else :src="imgBaseUrl + 'icon-eye-close.png'" class="icon-32 ml-8" />
		</block>
	</view>
</template>

<script setup lang="ts">
import useCommonStore from "@/store/common"
defineProps({
	color: String,
})
const imgBaseUrl = inject("imgBaseUrl")
const commonStore = useCommonStore()

const updateDesensitize = () => {
	commonStore.updateDesensitize(!commonStore.desensitize)
}
</script>

<style scoped lang="scss"></style>
